import moment from "moment";

export const globeCfg = window.cfg;

export const dateFormat = (date, patten = "YYYY-MM-DD HH:mm:ss") => (moment(date).format(patten));

export const dictFind = (key, defArray = []) => {
  let obj = defArray.find((item) => (item.defKey == key));
  if (obj)  return obj.defName;
  return '-';
};

export const fullHeight = () => (window.innerHeight - 200);
